﻿using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IService
{
    public interface IWhTransferService
    {
        /// <summary>
        /// 获取全部调拨单信息
        /// </summary>
        /// <returns></returns>
        List<GetAllWhTransfer> GetAllTransferOrderInfo();

        /// <summary>
        /// 根据调出仓库ID和调入仓库ID获取调拨商品信息
        /// </summary>
        /// <param name="outStockId"></param>
        /// <param name="inStockId"></param>
        /// <returns></returns>
        Task<List<WhTransferForAddWhTDetail>> GetTransferGoodsInfo(long outStockId, long inStockId);

        /// <summary>
        /// 调拨单添加（含明细和附件）
        /// </summary>
        /// <param name="mainModel"></param>
        /// <param name="detailList"></param>
        /// <param name="attachmentList"></param>
        /// <returns></returns>
        Task<int> AddWhTransferOrderInfo(
                                                    WhTransferModelWithMain mainModel,
                                                    List<WhTransferModelWithDetail> detailList,  // 允许为空列表
                                                    List<SysAttachmentDTO> attachmentList = null);

        /// <summary>
        /// 根据库位ID、仓库ID和商品ID查询该库位该商品的库存数量
        /// </summary>
        /// <param name="locationId"></param>
        /// <param name="warehouseId"></param>
        /// <param name="goodsId"></param>
        /// <returns></returns>
        Task<decimal> FindLocationQuantity(long locationId, long warehouseId, long goodsId);

        /// <summary>
        /// 审核调拨单
        /// </summary>
        /// <param name="am"></param>
        /// <returns></returns>
        int AuditeTransferOrder(AuditerModel am);

        /// <summary>
        /// 多条件查询调拨单
        /// </summary>
        /// <param name="swtwsm"></param>
        /// <returns></returns>
        Task<List<GetAllWhTransfer>> SelectTransferOrderWithSth(SelectWhTransferWithSthModel swtwsm);
    }
}
